package xin.marcher.module.construction.service.impl;

import org.springframework.stereotype.Service;
import xin.marcher.module.construction.domain.dto.BrandListDTO;
import xin.marcher.module.construction.domain.dto.BrandResultDTO;
import xin.marcher.module.construction.domain.request.BrandRequest;
import xin.marcher.module.construction.domain.request.QueryBrandRequest;
import xin.marcher.module.construction.repository.BrandRepository;
import xin.marcher.module.construction.service.BrandService;

import javax.annotation.Resource;

/**
 * 品牌服务
 */
@Service
public class BrandServiceImpl implements BrandService {

    @Resource
    private BrandRepository brandRepository;

    @Override
    public BrandResultDTO brand(BrandRequest brandRequest) {
        // 保存品牌信息
        brandRepository.saveOrUpdate(brandRequest);
        // 返回结果信息
        return new BrandResultDTO(Boolean.TRUE);
    }


    @Override
    public BrandListDTO getBrandInfoByLike(QueryBrandRequest queryBrandRequest) {
        // 返回结果
        return brandRepository.getBrandInfoByLike(queryBrandRequest);
    }
}
